---
id: prefer-dns
title: prefer-dns
description: Enforce usage of DNS instead of IP addresses | The Tracetest Analyzer analyzes OpenTelemetry traces
keywords:
  - tracetest
  - trace-based testing
  - observability
  - distributed tracing
  - testing
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---

Enforce usage of DNS instead of IP addresses.

## Rule Details

When connecting to remote servers, ensure the usage of DNS instead of IP addresses to avoid issues.

The following attributes are evaluated:

```yaml
- http.url
- db.connection_string
```

If span kind is `"client"`, the following attributes are evaluated:

```yaml
- net.peer.name
```

## Options

This rule has the following options:

- `"error"` requires DNS over IP addresses
- `"disabled"` disables the DNS over IP addresses verification
- `"warning"` verifies DNS over IP addresses but does not impact the analyzer score

## When Not To Use It

If you intentionally use and record IP addresses then you can disable this rule.
